package com.kaifamiao.demo.d0801.pm;

public interface ManFactory {

    Man createMan();

    Woman createWoman();
}

class BlackManFactory implements ManFactory {

    @Override
    public Man createMan() {
        return new BlackMan();
    }

    @Override
    public Woman createWoman() {
        return new BlackWoman();
    }
}

class WhiteManFactory implements ManFactory{

    @Override
    public Man createMan() {
        return new WhiteMan();
    }

    @Override
    public Woman createWoman() {
        return new WhiteWoman();
    }
}
